/*
 * @Author: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @Date: 2024-12-04 01:20:39
 * @LastEditors: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @LastEditTime: 2025-02-24 20:09:09
 * @FilePath: /vue-element-admin/src/api/user.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import request from '@/utils/request'

// export function login(data) {
//   return request({
//     url: '/vue-element-admin/user/login',
//     method: 'post',
//     data
//   })
// }



//获取菜单数据
export function getMenuByToken(roleId) {
  return request({
    url: '/sysMenu/getMenuByToken',
    method: 'get',
  })
}


export function getRolesPermissionList(roleId) {
  return request({
    url: `/sysRole/?roleId=${roleId}`,
    method: 'get',
  })
}
///忘记密码
export function forgetPassword(data) {
  return request({
    url: '/sysUser/forgetPassword',
    method: 'post',
    data
  })
}


//验证码
export function sendCode(data) {
  return request({
    url: '/sysUser/sendCode',
    method: 'post',
    data
  })
}


//手机号注册
export function phoneRegister(data) {
  return request({
    url: '/sysUser/phoneRegister',
    method: 'post',
    data
  })
}

//手机号登录
export function phoneLogin(data) {
  return request({
    url: '/sysUser/phoneLogin',
    method: 'post',
    data
  })
}



export function getTokenRoleAndMenu(token) {
  return request({
    url: '/sysRole/getTokenRoleAndMenu',
    method: 'get',
    // params: { token }
  })
}

export function getRouters(token) {
  return request({
    url: '/sysUser/getRouters',
    method: 'get',
    // params: { token }
  })
}

export function getInfo(token) {
  return request({
    url: '/sysUser/getUserInfo',
    method: 'get',
    // params: { token }
  })
}

export function logout() {
  return request({
    url: '/sysUser/logout',
    
    method: 'get'
  })
}

export function login(data) {
  return request({
    url: '/sysUser/login',
    method: 'post',
    data
  })
}

export function register(data) {
  return request({
    url: '/sysUser/register',
    method: 'post',
    data
  })
}
